package workexp.alg.question;

import org.junit.Test;

import java.util.Arrays;

public class ReverseString {
    public void reverseString(char[] s) {
        int i =0;
        int j = s.length-1;

        while (i<j){
            char tmp;
            tmp = s[i];
            s[i]=s[j];
            s[j]=tmp;
            i++;
            j--;
        }
    }

    @Test
    public void test(){
        char[] s= "zhukai".toCharArray();
        reverseString(s);
        System.out.println(Arrays.toString(s));
    }
}
